/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package kivuli.visao.item;

import java.awt.Graphics;
import java.awt.Graphics2D;
import kivuli.entidade.Muro;
import kivuli.visao.popup.PopupMuro;

/**
 *
 * @author JULIENA NOBRE SOARES
 */
public class ItemMuro extends ItemDeDesenho {

    public ItemMuro(Muro muro) {
        super(muro);
        this.setSize(8, muro.getComprimento() + 1);
        this.setComponentPopupMenu(new PopupMuro(this));
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Muro muro = (Muro) getFigura();
        setLocation(muro.getX(), muro.getY());
        Graphics2D g2d = (Graphics2D) g.create();
        g2d.fillRect(0, 0, 7, muro.getComprimento());
        g2d.dispose();
    }
}
